 <?php include('header.php');?>
   <div id="maincontent">
    <div id="left">
      <div class="marginbottom">
        <div><img src="images/zxfw.jpg" /></div>
        
          <script language="javascript" src="js/jquery-ui-1.7.3.custom/js/jquery-1.3.2.min.js"></script>
         <script language="javascript" src="js/jquery.marquee.js"></script>
         <script language="javascript">
         $(function(){
         	  $('#marquee').kxbdMarquee({direction:'up',scrollDelay:40});
         });
         </script>
         <style>
         	#marquee{overflow:hidden;height:800px;}
         </style>
        <div class="carpaddinga1">
        <div id="marquee">
         <div>
       <?php 
       		$dtRent = new DataTable(constant('DB_TABLE_RENT'));
      	 	$condition = "`show_on_front`='Y' ";
			$orderby = 'front_sn';
			$MAX_ITEM_NUMBER = Util::getGlobalValue('MAX_FRONT_RENT_NUMBER');
			$data_list = $dtRent->get_list($condition,$orderby,$MAX_ITEM_NUMBER);
			
			foreach($data_list as $rowData)
			{
			$image_path = $rowData['image1'];
			if(strlen($image_path) == 0)
				$image_path = $rowData['image'];
				
			$image_path = constant('SITE_URL_PATH').$image_path;
       ?>
       <dl>
				<dt><a href="zlb_details.php?id=<?php echo $rowData['id'];?>"><img src="<?php echo $image_path;?>"  width="262" height="133"  /></a></dt>
				<dd><a href="zlb_details.php?id=<?php echo $rowData['id'];?>"><?php echo $rowData['title'];?> <?php echo $rowData['size'];?>坪 <?php echo $rowData['cost'];?>元</a></dd>
		  </dl>
       <?php }?>
       
       		<?php
       			//check does need to load more ads
       			$extra_item_count = $MAX_ITEM_NUMBER - count($data_list);
       			if($extra_item_count > 0)
       			{
       				$condition = "`show_on_front`='N' ";
					$orderby = '-id';
					$data_list = $dtRent->get_list($condition,$orderby,$extra_item_count);
					foreach($data_list as $rowData)
					{
						$image_path = $rowData['image1'];
						if(strlen($image_path) == 0)
							$image_path = $rowData['image'];
				
						$image_path = constant('SITE_URL_PATH').$image_path;
						 ?>
      					 <dl>
								<dt><a href="zlb_details.php?id=<?php echo $rowData['id'];?>"><img src="<?php echo $image_path;?>"  width="262" height="133"  /></a></dt>
								<dd><a href="zlb_details.php?id=<?php echo $rowData['id'];?>"><?php echo $rowData['title'];?> <?php echo $rowData['size'];?>坪 <?php echo $rowData['cost'];?>元</a></dd>
		  				</dl>
		  				<?php
					}
       			}
       		?>
       
		    </div>
		  </div>
        </div>
      </div>
      <?php
         for($i=0;$i<constant('MAX_INDEX_AD_NUMBER');$i++)
		{
			$imgPath = Util::getGlobalValue('INDEX_IMAGE_PATH_AD_'.$i);
			if(strlen($imgPath) > 0)
			{
		?>
				<div class="marginbottom"><a href="<?php echo Util::getGlobalValue('INDEX_AD_LINK_'.$i);?>"><img src="<?php echo constant('SITE_URL_PATH').$imgPath;?>" /></a></div>
		<?php
			}
		}
		?>
    </div>
    <div id="right">
      <div class="marginbottom">
        <div class="righttitle1"><a href="zlb.php"><img src="images/more.jpg" /></a></div>
        <div class="rightbg">
          <?php echo Util::htmlStrAfterReadfromDb(Util::getGlobalValue('INDEX_SUMMARY_TEXT1'));?>
        </div>
        <div class="rightbottom"></div>
      </div>
      <div class="marginbottom">
        <div class="righttitle2"></div>
        <div class="rightbg">
         <?php echo Util::htmlStrAfterReadfromDb(Util::getGlobalValue('INDEX_SUMMARY_TEXT2'));?>
        </div>
        <div class="rightbottom"></div>
      </div>
      <div class="marginbottom">
        <div class="righttitle3"></div>
        <div class="rightbg">
         <?php echo Util::htmlStrAfterReadfromDb(Util::getGlobalValue('INDEX_SUMMARY_TEXT3'));?>
        </div>
        <div class="rightbottom"></div>
      </div>
    </div>
  </div>

 <?php include('bottom.php');?>